

#import "PurseView.h"

@implementation PurseView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    
    return self;
}

+ (instancetype)loadPurseView {
    
    PurseView *view = [[[NSBundle mainBundle]loadNibNamed:@"PurseView" owner:nil options:nil] firstObject];
    return  view;
}

- (IBAction)backButtonTaped:(id)sender {
    
    if (self.ownerVC != nil) {
        [self.ownerVC.navigationController popViewControllerAnimated:YES];
    }
}

- (IBAction)expense:(UIButton *)sender {
    NSInteger index = sender.tag - 400;
    
    if (self.delegate && [self.delegate respondsToSelector:@selector(purseView:didTapedCategoryButtonAtIndex:)]) {
        [self.delegate purseView:self didTapedCategoryButtonAtIndex:index];
    }
    
}


@end
